var gloading = {

    start: function(target) {
        if(!target) {
            target = document.querySelector('body');
        }
        window.global_spinner = new Spinner().spin(target);
        var maskInnerEl = document.createElement('div');
        maskInnerEl.className = 'loader-mask';
        target.appendChild(maskInnerEl);
    },
    
    stop: function() {
        if(window.global_spinner) {
            var maskEl =  window.global_spinner.el.parentNode.querySelector('.loader-mask');
            window.global_spinner.el.parentNode.removeChild(maskEl);
            window.global_spinner.stop();
            window.global_spinner = null;
        }
    }
};